from selenium import webdriver
import task.pageObject
class Driver:
    driver = None
    @classmethod
    def get_driver(cls):
        chrome_path = './driver/chromedriver'
        if cls.driver is None:
            cls.driver = webdriver.Chrome(chrome_path)
            cls.driver.get(task.pageObject.url)
            cls.driver.maximize_window()
        return cls.driver
    @classmethod
    def close_driver(cls):
        if cls.driver is not None:
            cls.driver.quit()
            cls.driver = None
if __name__ == '__main__':
    Driver().get_driver()
    # Driver().close_driver()